<#include "header.ftl">
<link href="${TEMPLATE_PATH}/css/user_base.css" rel="stylesheet" type="text/css" />
<link href="${TEMPLATE_PATH}/css/user_login.css" rel="stylesheet" type="text/css" />
<@shishuo_goods_item_tag goodsItemId="${id}" p="${p?c}" type="redirect">
 <div id="position">您所在的位置：<a href="{webroot}">首页</a> > <a href="{webroot}user/login.asp">会员登录</a></div>
    <div class="w980 mt10 mc">
        <div class="w900 bt">
           <div class="title" style="color:red">您尚未登录，去“淘宝”购物无法获得返现</div>
           <div id="userbase">
               <div class="left">
                    <form class="form_login" method="post">
                    <ul id="login">
                        <li class="msg" id="msg"></li>
                        <li>账户：<input type="text" name="userEntity.userName" id="userName" class="ip" data-rule="账户:required;username;" /></li>
                        <li>密码：<input type="password" name="userEntity.passWord" id="passWord" class="ip" data-rule="密码:required;password;" /></li>
                        <li class="p42"><input type="submit" value="登录" class="bnt_yellow" /> <input type="button" value="忘记密码" onclick="location.href='getpass.asp'" class="bnt_blue" /></li>
                    </ul>
                    </form>
               </div>
               <div style="text-align: left; line-height: 40px;height: 40px;font-weight: bold;  font-size: 20px;width: 400px;">
               <div id="timerStop" sytle="width: 300px;">将在 <span id="mes">3</span> 秒钟后跳转到购物网站！ <input type="button" value="停止" onClick="stopJump();" class="bnt_blue" /> </div>
               </div>
               <div style="text-align: right; line-height: 40px;height: 40px;font-weight: bold;  font-size: 20px;width: 600px;">
               <input type="button" style="height: 35px;" onClick="openUrl('<#if tag_goods_item.productClickUrl??>${tag_goods_item.productClickUrl}<#else>#</#if>');" value="不要返现，先去看看>>">
               </div>
               <div class="midline"></div>
               <div class="info">
                   <p>还没有帐号？</p>
                   <p class="bnt"><a href="/user/reg.htm">立即注册</a></p>
               </div>
           </div>
        </div>
    </div>
<script>
$(function(){
	$(".form_login").validator(
	{
		stopOnError:true,
		theme:'yellow_right_effect',
		ignore:':hidden',
		valid:function(form)
		{
			$.fn.tips({type:'loading',content:'数据提交中'});
			$.ajax(
			{
				url:"/user/login.json",
				type:"post",
				data:$(form).serialize(),
				dataType:"json",
				success:function(data){
					var type="warn";
					if(data.result==true){type="ok";}
					$.fn.tips({type:type,content:data.msg});
					if(data.result==true)
					{
						setTimeout(function(){location.href="?"},50);
					}
				},
				error:function(XMLHttpRequest, textStatus, errorThrown){
					$.fn.tips({type:"error",content:XMLHttpRequest.responseText});
				}
			});
		}
	});
});
function openUrl(url){
	if(url!=''){
		window.location.href=url; 
	}
}
var i = 2; 
var intervalid; 
intervalid = setInterval("fun()", 1000); 
function fun() {
	if (i == 0) { 
		window.location.href = "<#if tag_goods_item.productClickUrl??>${tag_goods_item.productClickUrl}</#if>"; 
		clearInterval(intervalid); 
	} 
	document.getElementById("mes").innerHTML = i; 
	i--; 
}
function stopJump(){
	clearInterval(intervalid);
	$("#timerStop").html("");
}
$(function(){
	$.ajax(
	{
		url:"/user/getLoginUser.json",
		type:"get",
		data:"",
		dataType:"json",
		success:function(data){
			if(data.result==true)
			{
				window.location.href = "<#if tag_goods_item.productClickUrl??>${tag_goods_item.productClickUrl}</#if>"; 
			}
		},
		error:function(XMLHttpRequest, textStatus, errorThrown){
		}
	});
});
</script>
</@shishuo_goods_item_tag>
<#include "footer.ftl">